# -*- coding: utf-8 -*-
'''
openn(self,p1,p2,diff,amount,rate,add,amount_p1,amount_p2,direction)
close(self,p1,p2,diff,amount,rate,amount_p1,amount_p2)
circle(self,p1,p2,open_dif,close_dif,amount,rate,amount_p1,amount_p2)
p1<p2 空远月  p1>p2 多远月  diff 开平仓价差 rate杠杆率 
add 补仓数量   amount_p1 P1下单数量  amount_p2  P2下单数量
direction =1  加仓    =2 减仓
open_dif 开仓价差     close_dif 平仓价差
--- 火币--5930账户
ACCESS_KEY = ''
SECRET_KEY = ''
'''
import threading
import time
from Arbitrage import arbitrage as ss
s = ss('','')
if __name__ == '__main__':
    threads = []
    t1 = threading.Thread(target = s.openn , args=('BTC_CQ','BTC_NQ',0.0505,20,50,0,20,21,1))
    # t2 = threading.Thread(target = s.openn , args=('BTC_CQ','BTC_NQ',0.0505,2000,50,0,20,21,1))
    # t3 = threading.Thread(target = s.openn , args=('BTC_CQ','BTC_NQ',0.0515,1000,50,0,20,21,1))
    # t4 = threading.Thread(target = s.openn , args=('BTC_CQ','BTC_NQ',0.0511,2000,50,0,20,21,1))
    # t5 = threading.Thread(target = s.openn , args=('BTC_CQ','BTC_NQ',0.0507,2000,50,0,20,21,1))
    # t6 = threading.Thread(target = s.openn , args=('BTC_CQ','BTC_NQ',0.052,2000,50,0,20,21,1))

    threads.append(t1)
    # threads.append(t2)
    # threads.append(t3)
    # threads.append(t4)
    # threads.append(t5)
    # threads.append(t6)
    
    for i in threads:
        i.start()
        time.sleep(1.23)

#s.openn('ETH_CQ','ETH_NQ',0.036,1,50,0,1,1,1)
#s.close('ETH_CQ','ETH_NQ',0.038,1,50,1,1)
# s.circle('ETH_CQ','ETH_NQ',0.0375,0.033,3,50,1,1)


